import request from "@/utils/request";
import qs from "qs"

/** 驱动列表 */
export function listIndex(data = {}, params = {}) {
  return request({
    url: "/index",
    method: "GET",
    data,
    params,
  });
}

/** 驱动复制 */ 
export function copyMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/copy",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}

/** 驱动删除 */ 
export function delMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/remove",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}


/** 连接复制 */ 
export function copyConnector(data = {}, params = {}) {
  return request({
    url: "/connector/copy",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}

/** 连接删除 */ 
export function delConnector(data = {}, params = {}) {
  return request({
    url: "/connector/remove",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}

/** 连接增加 */ 
export function addConnector(data = {}, params = {}) {
  return request({
    url: "/connector/add",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}

/** 连接详情 */ 
export function findConnectorPage(id) {
  return request({
    url: "/connector/page/edit?id="+id,
    method: "GET"
  });
}

/** 连接修改 */ 
export function updataConnector(data = {}, params = {}) {
  return request({
    url: "/connector/edit",
    method: "POST",
    data:qs.stringify(data),
    params,
  });
}


/** 驱动启动 */ 
export function startMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/start",
    method: "POST",
    data,
    params
  });
}

/** 驱动停止 */ 
export function stopMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/stop",
    method: "POST",
    data,
    params
  });
}

/** 驱动新增 */ 
export function addMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/add",
    method: "POST",
    data: qs.stringify(data),
    params
  });
}

/** 驱动回显 */ 
export function findMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/page/edit",
    method: "GET",
    data,
    params
  });
}

/** 驱动编辑 */ 
export function updataMapping(data = {}, params = {}) {
  return request({
    url: "/mapping/edit",
    method: "POST",
    data: qs.stringify(data),
    params
  });
}

/** 驱动表格添加 */ 
export function addTableGroup(data = {}, params = {}) {
  return request({
    url: "/tableGroup/add",
    method: "POST",
    data: qs.stringify(data),
    params
  });
}

/** 驱动表格删除 */ 
export function delTableGroup(data = {}, params = {}) {
  return request({
    url: "/tableGroup/remove",
    method: "POST",
    data: qs.stringify(data),
    params
  });
}

/** 驱动表格刷新 */ 
export function refreshTables(data = {}, params = {}) {
  return request({
    url: "/mapping/refreshTables",
    method: "POST",
    data: qs.stringify(data),
    params
  });
}



